package com.feng.springbootpropertiesdemo2.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: lrf
 * @create: 2019-09-07
 **/
@Data
@Component
@ConfigurationProperties(prefix = "book")
public class BookSettings {

    /**
     * 属性名称一定要和 application.properties 属性文件中属性名称保持一致，不然值为null
     */
    private String name;
    private double price;
}
